<template>
	<view class="addr">
		<view class="list flex-between" v-for="(item,index) in 5">
			<view class="left flex" @click="changeDefault(index)">
				<view class="iconfont iconduihao2 flex-center"></view>
				<view class="info">
					<view class="flex name-tel">
						<view class="name">张召林</view>
						<view>13243161556</view>
						<view class="default" v-if=" index == 0">默认</view>
					</view>
					<view class="address">地址：大学科技园</view>
		
				</view>
			</view>
			<navigator url="/pages/user/addAddr?type=1" class="right" hover-class="none">编辑</navigator>
		
		</view>
		<view class="footer flex-center">
				<navigator url="/pages/user/addAddr" hover-class="none" class="add-btn flex-center">新增地址</navigator>
		</view>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		methods:{
			// 改变默认地址
			changeDefault(index){
				uni.showModal({
					title:'温馨提示',
					content:'是否切换当前地址？',
					confirmColor:"#039702",
					success:r=>{
						if(r.confirm){
							// 确认操作
						}
					}
				})
			}
		}
	}
</script>

<style lang="less">
	@main-color:#039702;
	page{
		background: white;
		padding: 0 30rpx;
	}
	.list{
		padding: 20rpx 0;
		border-bottom: 2rpx solid #eee;
		.iconfont {
			color: #039702;
			width: 36rpx;
			height: 36rpx;
			border-radius: 50%;
			box-sizing: border-box;
			border: 2rpx solid #999;
			margin-right: 15rpx;
		
		}
		
		.iconduihao2 {
			font-size: 38rpx;
			color: #039702;
		}
		.info{
			width: 560rpx;
			.name-tel{
				font-size: 30rpx;
				color:#666;
				margin-bottom: 10rpx;
				.name{
					margin-right: 30rpx;
					
				}
				.default{
					font-size: 20rpx;
					padding: 2rpx 15rpx;
					margin-left: 10rpx;
					color:@main-color;
					border:1rpx solid @main-color;
					border-radius: 10rpx;
					transform: scale(.8);
				}
			}
			.address{
				font-size: 26rpx;
			}
		}
		.right{
			font-size: 28rpx;
			padding-left: 20rpx;
			border-left: 2rpx solid #ddd;
		}
	}
	.footer{
		position: fixed;
		bottom:0;
		left: 0;
		width: 100vw;
		height: 80rpx;
		background: white;
		z-index: 1;
		.add-btn{
			width: 680rpx;
			height: 60rpx;
			border-radius: 30rpx;
			background: @main-color;
			font-size: 30rpx;
			color:#fff;
		}
	}
</style>
